import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
import * as Icons from '@ant-design/icons-vue';
import router from './router'
router.afterEach(function (to, from) {
  document.title = to.meta.title == undefined ? '演示' : to.meta.title
});

// 引入中文语言包  
import zhCN from 'ant-design-vue/es/locale/zh_CN';

// 仅在开发环境中使用Mock.js

import('./mock');

import { createPinia } from 'pinia'; // 引入 Pinia

const app = createApp(App);

const pinia = createPinia(); // 创建 Pinia 实例
app.use(pinia); // 将 Pinia 挂载到 Vue 应用

// 全局注册所有图标组件
Object.keys(Icons).forEach(key => {
  app.component(key, Icons[key]);
});

app.use(router).use(Antd, { locale: zhCN })

app.mount('#app');